x86/paging: make log-dirty operations preemptible
authorJan Beulich <jbeulich@suse.com>
Mon, 6 Oct 2014 09:22:04 +0000 (11:22 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 6 Oct 2014 09:22:04 +0000 (11:22 +0200)
commit070493dfd2788e061b53f074b7ba97507fbcbf65
treeaf4e96455bebb7cc6e79d27482610592515649e6
parent5a3eef4fbf7b16fb499c17021625bc997ef8bebd
x86/paging: make log-dirty operations preemptible

Both the freeing and the inspection of the bitmap get done in (nested)
loops which - besides having a rather high iteration count in general,
albeit that would be covered by XSA-77 - have the number of non-trivial
iterations they need to perform (indirectly) controllable by both the
guest they are for and any domain controlling the guest (including the
one running qemu for it).

Note that the tying of the continuations to the invoking domain (which
previously [wrongly] used the invoking vCPU instead) implies that the
tools requesting such operations have to make sure they don't issue
multiple similar operations in parallel.

Note further that this breaks supervisor-mode kernel assumptions in
hypercall_create_continuation() (where regs->eip gets rewound to the
current hypercall stub beginning), but otoh
hypercall_cancel_continuation() doesn't work in that mode either.
Perhaps time to rip out all the remains of that feature?

This is part of CVE-2014-5146 / XSA-97.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/domain.c
xen/arch/x86/domctl.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/mm/paging.c
xen/arch/x86/x86_64/compat/entry.S
xen/arch/x86/x86_64/entry.S
xen/common/domain.c
xen/include/asm-x86/domain.h
xen/include/asm-x86/paging.h